import React, { createContext, useState, useReducer } from "react";

const AppContext = createContext();
const { Provider } = AppContext;
export function Store(props) {
  const [storeData, setsetstoreData] = useState([
    { name: "sss", id: 1 },
    { name: "fssa", id: 2 },
  ]);
  console.log(props);

  return (
    <Provider value={{ storeData, setsetstoreData }}>{props.children}</Provider>
  );
}

const ModalVisible = createContext();
const VisibleProvider = (props) => {
  const [visible, setVisible] = useState(false);
  return (
    <ModalVisible.Provider value={{ visible, setVisible }}>
      {props.children}
    </ModalVisible.Provider>
  );
};

export default { VisibleProvider, AppContext };
